package com.woniuxy.shop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniuxy.shop.entity.Shop;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Mapper
public interface ShopMapper extends BaseMapper<Shop> {

    //通过门店id查询门店详情
    @Select("select * from shop where sid=#{sid}")
    Shop viewShop(@Param("sid") int sid);

    //通过门店地址搜索门店
    @Select("select * from shop where addr=#{addr}")
    Shop findByAddr(@Param("addr") String addr);

    //通过门店名称搜索门店
    @Select("select * from shop where name=#{name}")
    Shop findByName(@Param("name") String name);
}
